/*
 * @Author: Baishui
 * @Date: 2021-09-23 20:32:50
 * @LastEditors: Baishui
 * @LastEditTime: 2021-10-21 10:48:32
 * @Description: file content
 */

import { MockMethod } from 'vite-plugin-mock'
import { resultSuccess } from '../util'
import { Random } from 'mockjs'

// icon
// HomeOutlined,
// AppstoreOutlined,
// AccountBookOutlined,
// AimOutlined,
// ApartmentOutlined,
// CarryOutFilled,
// BlockOutlined,

const menuList = [
  {
    id: Random.id(),
    title: '首页',
    path: '/home',
    icon: 'HomeOutlined',
    children: null,
  },
  {
    id: Random.id(),
    title: '图表',
    path: '/charts',
    icon: 'AccountBookOutlined',
    children: [
      {
        id: Random.id(),
        path: '/charts/d3',
        title: 'D3',
      },
      {
        id: Random.id(),
        path: '/charts/echart',
        title: 'Echart',
      },
      {
        id: Random.id(),
        path: '/charts/maptalks',
        title: 'Maptalks',
      },
      {
        id: Random.id(),
        path: '/charts/threejs',
        title: 'Threejs',
      },
      {
        id: Random.id(),
        path: '/charts/zender',
        title: 'Zender',
      },
    ],
  },
  {
    id: Random.id(),
    title: '功能',
    path: '/feat',
    icon: 'AimOutlined',
    children: [
      {
        id: Random.id(),
        path: '/feat/anchor',
        title: '导航栏锚点',
      },
      {
        id: Random.id(),
        path: '/feat/download',
        title: '下载',
      },
      {
        id: Random.id(),
        path: '/feat/imgPreView',
        title: '图片预览',
      },
      {
        id: Random.id(),
        path: '/feat/print',
        title: '打印',
      },
    ],
  },
  {
    id: Random.id(),
    title: '组件',
    path: '/comp',
    icon: 'CarryOutFilled',
    children: [
      {
        id: Random.id(),
        path: '/comp/basic',
        title: '基础',
      },
      {
        id: Random.id(),
        path: '/comp/tables',
        title: '表格',
      },
    ],
  },
]

export default [
  {
    url: '/app/test',
    timeout: 200,
    method: 'get',
    resopnse: () => {
      return resultSuccess({
        user: 'jack',
        age: 10,
      })
    },
  },
  {
    url: '/app/menuList',
    timeout: 200,
    method: 'post',
    response: () => {
      return resultSuccess(menuList)
    },
  },
] as MockMethod[]
